Tracking a document through changes to the document can be useful for backup and synchronization operations. A common way to track a document is to save a file identifier that is unique within a file system, such as a POSIX file identifier, in a metadata structure associated with the document. Techniques for tracking a document are known in the art, including those used in Spotlight® (a search facility on Macintosh® OS X from Apple® Inc.), described in U.S. Pat. No. 7,437,358, and in synchronization techniques for iCloud® from Apple® Inc. These techniques require timers to determine when a file operation has occurred on an edited document.
A typical example in which it is desirable to track a document is during a “safe save” operation in a file system of a data processing system. In a safe save, a user has an original document having an original filename, e.g. “foo”, having an original file identifier, such as a POSIX file identifier. When a user edits the original document with an application program, the file system creates a temporary file from the original document called, e.g., “foo temp”, and assigns a new file identifier to the temporary file. The new file identifier of the temporary file is different from the original file identifier of the original document. The user edits are then saved to the temporary file “foo temp”, either automatically by the data processing system or upon user request. Once the temporary file is confirmed as having been successfully saved, then the file system renames the edited, temporary file from “foo temp” to “foo” over the original document. This process can be referred to as a safe save because the renaming of the edited, temporary file over of the original document occurs after confirming that the temporary file has been successfully, i.e. safely, saved. After a safe save, the edited temporary file gets the filename “foo” of the original document, but keeps the new file identifier and inode of the temporary file. Thus, it is difficult to track a document by its file identifier once the tracked document has been processed through a safe save, because the file identifier of the file having the filename of the original document can change during the safe save operation.